package cn.leyaber.hrm.service.impl;

import cn.leyaber.hrm.domain.Name;
import cn.leyaber.hrm.mapper.NameMapper;
import cn.leyaber.hrm.redusutils.constants.CommentConstant;
import cn.leyaber.hrm.service.INameService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ma.rui.kai
 * @since 2020-12-11
 */
@Service
public class NameServiceImpl extends ServiceImpl<NameMapper, Name> implements INameService {
  @Autowired
  private NameMapper nameMapper;
    @Override
    public void Modify_status(Name name) {
        if (name.getOrderState().equals(CommentConstant.COMMENT_DISABLE)){
            name.setOrderState(CommentConstant.COMMENT_ENABLE);
            nameMapper.updateById(name);
        }else {
            name.setOrderState(CommentConstant.COMMENT_ENABLE);
            nameMapper.updateById(name);
        }
    }
}
